package com.ruoyi.app.controller;

import com.ruoyi.ad.domain.CmsAd;
import com.ruoyi.ad.service.ICmsAdService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 【请填写功能名称】Controller
 * 
 * @author hct
 * @date 2022-09-29
 */
@RestController
@RequestMapping("/app/public/ad")
public class AppAdController extends BaseController
{
    @Autowired
    private ICmsAdService cmsAdService;

    /**
     * 查询【请填写功能名称】列表
     */
    @GetMapping("/index")
    public TableDataInfo index(CmsAd cmsAd)
    {
        List<CmsAd> list = cmsAdService.selectCmsAdList(cmsAd);
        return getDataTable(list);
    }

    /**
     * 查询【请填写功能名称】列表
     */
    @GetMapping("/list")
    public TableDataInfo list(CmsAd cmsAd)
    {
        List<CmsAd> list = cmsAdService.selectCmsAdList(cmsAd);
        return getDataTable(list);
    }


    /**
     * 获取【请填写功能名称】详细信息
     */
    @GetMapping(value = "/detail/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(cmsAdService.selectCmsAdById(id));
    }


}
